#!/usr/bin/env python

from google.appengine.ext import db

import appengine_admin

class JarResource (db.Model):
	Name = db.StringProperty()
	Description = db.StringProperty()
	Downloaded = db.IntegerProperty()
	DateAdded = db.DateTimeProperty(_("Added"), auto_now_add = True)

class BuildType (JarResource):
	Version = db.StringProperty()
	Data = db.BlobProperty()

class SmilesType (JarResource):
	Author = db.StringProperty()	
	Images = db.BlobProperty()
	Text = db.TextProperty()

class AdminBuilds(appengine_admin.ModelAdmin):
	model = BuildType
	listFields = (_('Name'), _('Description'), _('Version'), _('Downloaded'), _('DateAdded'))
	editFields = (_('Name'), _('Description'), _('Data'))
	readonlyFields = (_('Downloaded'), _('DateAdded'))

class AdminSmiles(appengine_admin.ModelAdmin):
	model = SmilesType
	listFields = (_('Name'), _('Description'), _('Author'), _('Downloaded'), _('DateAdded'))
	editFields = (_('Name'), _('Description'), _('Images'), _('Text'))
	readonlyFields = (_('Downloaded'), _('DateAdded'))


appengine_admin.register(AdminBuilds, AdminSmiles)
